Prime Defective
by MoryP
Summary: The Enterprise is experiencing technical difficulties, but the ship itself seems to be in perfect condition.


Aboard the Enterprise, Deanna was having a counselling session with one of her clients. The client expressed that, although everything was going just fine on the surface, they still felt that the people close to them, as well as their colleagues, still held a bit of animosity towards them.

"What makes you think that they have something against you?", Deanna asked her client.

"Well, whenever they ask me something to do, I make sure that I do it just right. I double check my work, sometimes triple check it. But the more I try to make sure its what they want, they seem to grow impatient, and ultimately become unhappy with whatever it is I've done for them."

"Hmm. Interesting. What usually happens afterwards? How do you move past it?"

"Well, its like they shut down on me. But after awhile, things are back to normal and I feel like we're in good graces again. That is, until I'm called on to do another task for them, and then the whole cycle repeats."

Deanna finished counselling the client and then went to the bridge.

It was a routine shift on the bridge of the Enterprise. The crew were talking amongst themselves when suddenly Geordi stopped and looked startled.

"What's wrong?" Deanna asked him.

"Did you all see that?" Geordi asked.

"See what Geordi?"

"The lights here on the bridge quickly turned off and on,'' he explained.

"I didn't see anything" the captain remarked.

"It must be the blessing and the curse of a visor-you don't miss anything."

He decides to ignore it and continue talking with the crew. Moments later, the lights briefly flicker off and on. This time it was long enough for the others to notice it.

"I saw it that time. What's going on?" Riker asked.

Data turned to his control panel to check the general status of the ship.

"Everything appears to be running at normal levels,''Data reported.

"Maybe it's due to our current location in this system."

The lights flicker once again. The Captain stated, "I don't know what it is but to be on the safe side, we should bring our ship into the nearest Outpost for maintenance."

They set a course for the nearest Outpost. Along the way, another power shutdown occurs. This one lasted even longer.

"Not again!", the crew groaned

"Helm do you still have control of the ship?" the Captain asked.

"No sir, I've lost navigation control!"

Riker commented, "So I guess it's not just the lights that are shutting off it's the entire functionality of the ship"!

"Captain, more bad news. There's an asteroid approaching towards us rapidly."

"Red Alert!?" Riker tried calling out, but nothing happened since the power was off.

Geordi noted, "Our shields are probably down also, and a simple asteroid like that could do some serious damage to our hull."

The Captain stuck his badge in an attempt to make a ship wide announcement, "This is the captain. To anyone who can hear me; all hands brace for impact!"

Picard and Worf quickly began discussing an evacuation plan when suddenly, the lights and power turned back on.

"Helmsman get us out of here immediately!"

"Yes captain."

The ship narrowly avoids the asteroid collision and finds a safe place to stop the ship. After everyone settles down, Picard commands all personnel to investigate the cause of the shutdown.

The crew investigates, and as they do, they experience other shutdowns several minutes apart. After hours of Investigation, Geordi and Data report.

"Captain, we've looked at every system, every analysis, and every resource we can get our hands on."

"And…"

"We've got nothing. The computer reports nothing out of the ordinary."

The Captain thought for a moment. "Could there be something wrong with the computer itself. Maybe it downloaded some malicious data?"

"That's what we thought,'' Geordi answered, "but we scanned it for viruses or anything out of the ordinary and everything checks out the computer itself is in its perfect original form. Still no clue as to why the ship is shutting down on us."

When Deanna heard that last phrase, something clicked in her mind.

"What if that's the problem?" She surprisingly asked.

"Counselor?"

She explained, "Well, I can't speak for the technological side of things, but I just had a counselling session with a client that tell me that they were doing everything for others, in the most efficient way possible. But because they put so much effort into getting everything just right, the people they were trying to please became frustrated and impatient with amount of energy it took to get the task done. Think about a waiter who constantly asks you about every little thing concerning your meal. They strive so hard to be effective, that it actually becomes a nuisance."

Data thought on her metaphor and then replied, "So you're suggesting that maybe the computer is trying to be so efficient that is causing itself to momentarily lose power?"

"It's possible. When's the last time you guys did and inspection of the computer's basic objectives? Maybe they are set too high." she asked.

"It's an intriguing theory," Data replied. "But to check it out we'd have to have direct physical access to the computers core from the inside. The only way to get there will be to teleport inside of the computer's internal area."

Picard interjected. "Let's keep looking for other causes for now. Number one, see if you can…"

In the middle of Picard's statement, the power across the shiip shuts off again.

"Looks like we're running out of options,'' Geordi lamented. "Each shutdown is lasting longer than the one before it. Soon we'll be out of power for hours if not days at a time."

The crew decided that when the power came back on the officers would be teleported into the internal computer area. Before they were transported, they ran tests to make sure that if a shutdown occurred in the middle of a transport, that they would be able to rematerialize the transport patterns once the power turned back on. After the test proved successful, Data, Geordi, Picard, Worf, and Riker were transported into the internal computer room. They then began to search the area for any "over-efficient" objectives and functions.

The internal computer room was filled with blinking lights, wires, bleeps and blips, and moving parts which all seemed to flow perfectly together in a comprehensible sequence of events.

"I don't see anything over efficient here." Geordi observed. "Everything looks good."

They walked around the room they then saw a panel of lights that caught their attention.

"Hey, look at this." one of them remarked.

This panel of lights was arranged like stars. They were small points flights sprawled about against a black panel like a galaxy. Some of the lights were shining brighter than others. Underneath the chart of lights was a very large number.

"I wonder what Galaxy this is a chart of."

"Or if its a chart of a galaxy at all. For all we know, these lights could represent an arrangement of molecules, populations, ..almost anything. And who knows what this large number represents"

"We should probably review it in the stellar cartography lab." The Captain stated "Riker, Worf and I will head back to the main area of the ship. We'll let you two stay here to see if we can find out any more information from the inside."

"Understood." Geordi and Data replied.

After they set up a visual monitoring device to it, Riker tapped his communicator, "Transporter Room 2, The Captain, Worf, and myself to beam out"

"Yes sir", O'brien stated back over the communicator.

As they beamed out, what they feared the most happened. The power shut off once again. The lights inside the computer room shut off.

"Oh no! Not now!" Shouted Data and Geordi.

"Transporter Room 2! O'brien did you get them?!"

"They can't hear us, now that the power is off."

All of the lights in the room were off except for the panel of lights arranged like stars. Geordi and Data noticed.

"These 'star lights' are still on, and they are flickering faster and faster. I bet that whatever these lights are processing is the cause as to why the power keeps shutting down."

They stared at the flashing lights as they increased speed. They were the only thing that could be seen in this now pitch dark room. They became mesmerized by them when some time later, the power restored. The power restoration broke their trance, but they noticed something different about the display. A new light on the display was shining which wasn't lit up before.

"Look, at that new light. It wasn't there before." Geordi exclaimed.

"Yeah I noticed." Data replied "It's as if a new star was born."

"Also, the number beneath the lights has been incremented by one. Infact, if my math is right, it seems to have increased once each minute that we've been here."

Geordi inquired the computer. "Computer, what does this chart of lights represent".

"Unknown", the computer replied.

"Unknown? Shouldn't you know?" Geordi stated. "Well computer, can you tell us: what does this large number represent."

"Unknown", the computer replied again.

"Computer, let's not get ridiculous,'' Geordi muttered.

Data decided to give his inquiries a try. "Computer, are these lights and this number performing a calculation of some kind?"

"Affirmative".

"What kind of calculations?"

"Arithmetic Division"

"Division?" Geordi said, stunned. "Why would you be doing a series of divisions on this number and with these lights?

"Unknown" the computer replied.

Geordi sighed in audible frustration. He thought out loud to himself "So you're calculating this large number, using division, and you're taking up all the ships power to do so...and you don't know why? Hmm…."

Suddenly, as if struck with an epiphany, Data declared. "Geordi, I think I know what these lights and this number represent, and why its processing is causing the ship to shut down."

Just then O'brien came in over the communications

"This is Chief O'brien to Commander Laforge"

"Yes, Chief. Tell us you got the Captain and the other officers."

"I'm working on it." O'brien explained. "The power outage put their transport patterns into stasis. I'm working on descrambling them. It will take me 10 to 15 minutes at least, that is, of course, provided that we don't have any more shutdowns until then."

"Understood. The good news is that Data was just going to tell me what he thinks is going on here. Data, you want to let us know about your hypothesis?"

Geordi looked over at Data, but he was on the ground convulsing in a seizure-like manner.

"Data! What's wrong?!"

Data continued to shake and stutter.

"What's going on over there Commander?" O'brien asked over the comm.

"I don't know! Data's malfunctioning badly. He's probably been in this room too long and the concentrated electrostatic energy is interfering with his internal functions."

"Do you want me to transport you two out of there?"

"Ummmm... " Geordi thought about it. He didn't want to risk getting caught in a shutdown during transport like the others.

"I don't really want to risk it, but he's breaking down pretty badly. Go ahead and transport us out."

"Aye sir!"

O'brien transports them out, and they materialize on the other side safely.

Geordi is able to repair Data.

Once stable, Data requests that the remaining senior staff meet with him so that he could explain the cause of the shutdowns. Data begins to explain the situation. He shows the visual monitoring of the flashing lights and the large number to the staff.

"Basically. " he begins, "the reason why the ship periodically loses power is because, with every minute of time, it is trying to calculate to see if that minute of time is a prime number."

"Prime number?"

"Yes,", Data continues. "The computer is taking the numerical representation of the current minute of time and trying to see if that number is prime or not. The only way to check if a number is prime is to divide it by lesser prime numbers. The display of lights we saw in the internal computer room was a visual representation of that process. So if a minute finds a suitable dividend, the process will terminate within the minute and the ship will function normally. But if doesn't find a dividend within a minute, the entire ship will stall until its fully proven that it has no dividend, which means that that number is a prime number. "

Geordi followed up, "That's why after the shut down was over, a new light was shining. The shining lights represent the prime numbers that have already been found. The computer is exploring each number, and when it finds out its prime, it shines it like a newborn star. The large number increments by one,and the new division process is done for that minute of time."

"Ok, but why, " Deanna asked. "Why would the Enterprise dedicate its resources to this task?"

Data elaborated, "The Enterprise's objective is to 'seek out new life and new civilizations' and to 'boldly go where no one has gone before. That mantra was programmed right into the core of the Enterprise's itself. When we asked the computer what is was calculating, it replied with 'unknown'. I now understand that 'Unknown' referred to the search in general for unknown prime numbers. The computer must have realized that prime numbers were an area still left for exploration, so it decided to use its resources to discover these new numbers."

Doctor Crusher asked, "That sounds noble and that's good for the Enterprise, but of the calculations are just for exploration, can we stop it? At least for now?"

"Yes and no," Data answered. "To deny the Enterprise of this exploration would mean we'd have to deny it of all exporation, making the ship virtually unusable. The only other option we have is to give it what its searching for; all of the prime numbers."

"All of the prime numbers? How are we going to do that?" O'brien interjected, "We're a bunch of smart people, but all of us combined could calculate faster than the computer."

"True, " Data continued. "But if we could give the computer an equation that's much faster than division, then it could find out if a number is prime without shutting down the ship."

"Give the computer an equation? That's sounds even harder!" exclaimed the Doctor. "We're not mathematicians. If the ancient mathematicians haven't thought of a prime formula yet, we'll never come up with one."

"Yeah, it's too bad we don't have brainiacs like that on board, maybe Deanna could've read their minds", O'brien chimed.

Data continued. "Maybe Deanna can't read the mind of a mathematician right now." He then turned to Deanna, "But perhaps you could read the mind of mathematics itself."

"What?!" Deanna reacted in disbelief, nearly spewing out the water she had been sipping. "Commander, no offense, but you're sounding weirder and weirder."

Data replied. "I understand how this may sound, but remember, you were the one who understood the nature of the ship's computer by determining that it was being over efficient. Your intuitive understanding of people may be the most valuable asset in understanding the unpredictability of prime numbers. Because, just like people, what seems to be totally random, usually has a fundamental concept at its core."

"I wouldn't even know where to begin,'' she admitted.

"I'd imagine you would have to be in the highest meditative state possible."

"I actually should be able to help you with that by inducing you into a partial coma", noted the Doctor.

"Right, and we could transmit your brain patterns on an electromagnetic wavelength that Geordi could pick up on his visor", Data explained.

Deanna looked for the words to say in response. She wanted to help her crew, but she also was hesitant about going into high meditation while half unconscious, not to mention she'd have to concentrate heavily on math, which was her least favorite subject. Before she could respond, the power in the ship went off yet again. O'brien slammed the table in frustration.

"Drat! Now the teleportation descrambling sequence of Captain and the officers has to start all over! Sorry commander, I need to head to the transporter room to reset it."

"Understood." O'brien stumbled his way to the door in the dark. He ended up tripping and falling which just added to his already flaring anger. Once he got up said, "I don't know what you all plan to do, but if we lose power again, we've basically lost the Captain and the others for good."

O'brien left and Data turned his attention to Deanna. "As you can 'see' Counsellor, we're running out of options".

"I understand,''she said. "Let's do it."

Once the power came back on, the team began the initial stages of their plan. The plan was executed with much apprehension and caution. Deanna was putting herself at risk brain injury if she stayed in her meditative state for too long. Also, there was the risk of using the transporter to beam Data back into the internal computer room since it could shut down in the middle of transport, not to mention Data's risk of prolonged exposure to the room. The entire ship was literally praying for everything to work out.

They began the procedure. Deanna was sedated and her brain was connected to electromagnetic neural transmitters. Data was transported inside the internal computer room safely. After some time, Geordi began to describe the electromagnetic visions he was seeing as he picked up Deanna's brain waves. As Geordi read the descriptions over the communicator to Data, Data quickly applied formulas into the computer which best described his imagery. Eventually they found out the most efficient formula and Data finally entered the code into the ships core processor.

After inputting the last code data observed that the lights were no longer flickering but rather shining in a smooth steady state along with the rest of the computer's display. It was the last thing he saw before he went into violent spasms and shakes due to being in the computer room for too long. The team called out for him but when they heard his stuttering and his rambling O'Brien began to transport him out. Once transported, Geordi rushed over today that to repair him. The doctor also quickly began to resessuitate Deanna, while O'Brien frantically began trying to restore the backup patterns of the Captain in the rest of his officers. After some time the entire crew was restored and the problem with the shutdowns did not occur again.

All of the senior officers were meeting once again looking at a new video of the display lights. The lights were now moving in a cohesive fashion at a steady pace. The senior staff stared in silence at the lights and in hypnotic state. They all waited minute after minute to see if the large number at the bottom was prime or not and if a new star on the chart would be born.

"Well," the Captain said finally breaking the silence. "What do we name this new prime number formula?"

"The Enterprise formula?" one suggested.

"The 'Geordeanna Beverlidata Hyper Code'?" suggested another.

"How about the stuck in a transporter for 8 hours formula code?" Riker joked.

The crew laughed as they threw out other funny names.

The Captain continued. "Well whatever we call it, I'm just glad that we were able to help the computer explore new concepts safely just as it has done for us all these years."

"Indeed."

The crew went back to staring at the lights minute after minute as they strobed off and on peacefully going up to the meeting room like stars glistening in the night sky.


End file.
